<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var year = Number(prompt('请输入年份'))
    var a = Number(prompt('请输入1-12之间的一个月份'))
    switch(a){
        case 1:
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
            console.log('当月有31天');break
        case 2:
            if(year%4 == 0 && year%100 !=0 || year%400 == 0){
                console.log('当月有29天')
            }else{
                console.log('当月有28天')
            }
            break
        case 4:
        case 6:
        case 9:
        case 11:
            console.log('当月有30天');break
    }
</script>
</html>